#include "trapfilter_cofficient.h"

trapfilter_pDelayLinkList trapfilter_pDelay[8]; // 用于存储每个通道过去时刻滤波后的结果
bool TrapFilterStatus = false;                  // FIR陷波滤波状态标志
uint16_t FIR_Trapfilter_FilterLength = 505;     // FIR陷波滤波器阶数
double   FIR_Trapfilter_Coefficient[505] =      // FIR陷波滤波器权重系数
{
    -2.079997525139e-06,-6.168495385586e-06,-8.569689224285e-06,-7.738734063195e-06,
    -3.279192392481e-06,3.617638666754e-06,1.039583502641e-05,1.403910836083e-05,
    1.235558115453e-05,5.113380104981e-06,-5.519366411549e-06,-1.554166337062e-05,
    -2.059217202823e-05,-1.779989588537e-05,-7.241880705286e-06,7.690589013535e-06,
    2.131974605156e-05,2.782552576695e-05,2.370382871785e-05,9.507797669786e-06,
    -9.957517522342e-06,-2.722963388714e-05,-3.506295473559e-05,-2.947262385223e-05,
    -1.166536973145e-05,1.205547576873e-05,3.252812363544e-05,4.132288748444e-05,
    3.426076260148e-05,1.337185824666e-05,-1.362185762307e-05,-3.621380329085e-05,
    -4.530320402156e-05,-3.696301551091e-05,-1.41854732762e-05,1.419546271802e-05,
    3.702917163282e-05,4.538882738528e-05,3.622476448625e-05,1.357097126958e-05,
    -1.322380484262e-05,-3.348438934482e-05,-3.968695121378e-05,-3.047537385447e-05,
    -1.091430586061e-05,1.007970678377e-05,2.390590872561e-05,2.609366033173e-05,
      1.7987427443e-05, 5.54731725093e-06,-4.088071033061e-06,-6.512044929606e-06,
    -2.394148991664e-06,3.036677439071e-06,3.217087088799e-06,-5.436842394177e-06,
    -2.048397398496e-05,-3.36032209163e-05,-3.435093500679e-05,-1.603945819095e-05,
    1.914397061695e-05,5.874474703023e-05, 8.39010690493e-05,7.752678577496e-05,
     3.34989741319e-05,-3.758892624412e-05,-0.0001096564969229,-0.0001501199014663,
    -0.0001337931159346,-5.603097446612e-05,6.117028163222e-05,0.0001741592665557,
    0.0002332848867018,0.0002038613681484,8.385937109964e-05,-9.006132252278e-05,
    -0.0002525668821034,-0.0003336020859099,-0.0002877438933481,-0.0001169271808992,
    0.0001241406520938,0.0003443858772737,0.0004502359090013,0.0003845753815658,
    0.0001548290518074,-0.0001629256246492,-0.0004481440596034,-0.000581101300591,
    -0.000492448520268,-0.0001967501180958,0.0002055130133773,0.0005612404066697,
    0.0007226852669604,0.0006082758088021,0.0002414157724643,-0.0002505315211441,
    -0.0006798283871139,-0.0008699126949097,-0.0007276895966597,-0.000287056942751,
    0.0002961106891678,0.0007987445151994, 0.001016070878211,0.0008449918315216,
    0.0003313951813641,-0.000339870420803,-0.0009114929110682,-0.001152805696676,
    -0.0009531636597694,-0.0003716513038957,0.0003789347076752,   0.0010102948377,
     0.001270199980487, 0.001043942921725,0.0004045804550767,-0.0004099722320426,
    -0.001086209653151,-0.001356941291698,-0.001107974779333,-0.0004265353592891,
    0.0004292653503351, 0.001129330435574, 0.001400582279995, 0.001135037307426,
    0.0004335581719282,-0.0004328075845774,-0.001129053839164,-0.001387892093177,
    -0.001114340019443,-0.0004214998469812,0.0004164282240327,  0.00107441969511,
     0.001305292268612, 0.001034889173285,0.0003861643500111,-0.0003759410462029,
    -0.0009545116913322,-0.001139365365051,-0.0008859095325633,-0.0003234734601727,
    0.0003073125918354,0.0007589063815876,0.0008774196071331,0.0006573082823906,
     0.000229646412227,-0.0002068439657904,-0.000478154032777,-0.0005080883105905,
     -0.00034016326204,-0.0001013873231861,7.135887744586e-05,0.0001042716606279,
    2.193913013841e-05,-7.278518458777e-05,-6.392768304008e-05,0.0001016103320878,
    0.0003687737484127,0.0005879345064434,0.0005866614140034,0.0002680724174513,
    -0.0003136475277181,-0.0009446151871226,-0.001325368820778,-0.001204024331075,
    -0.0005118106605659,0.0005652975077996, 0.001624092323272, 0.002190660975566,
     0.001924503199761, 0.000794763120177,-0.0008559393554214,-0.002404937505748,
    -0.003180203691837,-0.002744521227623,-0.001115309470962, 0.001183696381146,
     0.003281561391535, 0.004286247559168, 0.003657125993647, 0.001470532496153,
    -0.001545389396381,-0.004244955056977,-0.005496810865886,-0.004651941895082,
    -0.001856209782175,   0.0019365384078, 0.005282720939258, 0.006795750953392,
     0.005715254892864, 0.002266856479552, -0.00235141582158,-0.006379239555625,
    -0.008163004242872,-0.006830234151034,-0.002695820423705, 0.002783151982391,
      0.00751597291675, 0.009574994513484, 0.007977288961625, 0.003135428513667,
     -0.00322389145528,-0.008671899181058, -0.01100520110166,-0.009134552931469,
    -0.003577180795346, 0.003664996011345, 0.009824066714064,  0.01242487084831,
      0.01027848111386, 0.004011986316879,-0.004097287928982, -0.01094824965863,
     -0.01380385026265, -0.01138453993351,-0.004430432645246, 0.004511325099163,
      0.01201968171995,  0.01511150790276,   0.0124279647012, 0.004823079077209,
    -0.004897697645061,  -0.0130138404286, -0.01631771176306, -0.01338455553491,
    -0.005180762151128, 0.005247334436862,   0.0139072509272,  0.01739382281623,
      0.01423147983567, 0.005494901155932,-0.005551807083748, -0.01467827653236,
     -0.01831366401331, -0.01494804828177,-0.005757790999761, 0.005803618771243,
      0.01530786308003,  0.01905442413902,  0.01551643169979, 0.005962870073808,
    -0.005996465707212, -0.01578020541592, -0.01959745798343, -0.01592228815591,
    -0.006104951624215, 0.006125459934824,   0.0160833073012,  0.01992894825616,
      0.01615527311126, 0.006180408591261,-0.006187303823948, -0.01620941034162,
       0.9799795775259, -0.01620941034162,-0.006187303823948, 0.006180408591261,
      0.01615527311126,  0.01992894825616,   0.0160833073012, 0.006125459934824,
    -0.006104951624215, -0.01592228815591, -0.01959745798343, -0.01578020541592,
    -0.005996465707212, 0.005962870073808,  0.01551643169979,  0.01905442413902,
      0.01530786308003, 0.005803618771243,-0.005757790999761, -0.01494804828177,
     -0.01831366401331, -0.01467827653236,-0.005551807083748, 0.005494901155932,
      0.01423147983567,  0.01739382281623,   0.0139072509272, 0.005247334436862,
    -0.005180762151128, -0.01338455553491, -0.01631771176306,  -0.0130138404286,
    -0.004897697645061, 0.004823079077209,   0.0124279647012,  0.01511150790276,
      0.01201968171995, 0.004511325099163,-0.004430432645246, -0.01138453993351,
     -0.01380385026265, -0.01094824965863,-0.004097287928982, 0.004011986316879,
      0.01027848111386,  0.01242487084831, 0.009824066714064, 0.003664996011345,
    -0.003577180795346,-0.009134552931469, -0.01100520110166,-0.008671899181058,
     -0.00322389145528, 0.003135428513667, 0.007977288961625, 0.009574994513484,
      0.00751597291675, 0.002783151982391,-0.002695820423705,-0.006830234151034,
    -0.008163004242872,-0.006379239555625, -0.00235141582158, 0.002266856479552,
     0.005715254892864, 0.006795750953392, 0.005282720939258,   0.0019365384078,
    -0.001856209782175,-0.004651941895082,-0.005496810865886,-0.004244955056977,
    -0.001545389396381, 0.001470532496153, 0.003657125993647, 0.004286247559168,
     0.003281561391535, 0.001183696381146,-0.001115309470962,-0.002744521227623,
    -0.003180203691837,-0.002404937505748,-0.0008559393554214, 0.000794763120177,
     0.001924503199761, 0.002190660975566, 0.001624092323272,0.0005652975077996,
    -0.0005118106605659,-0.001204024331075,-0.001325368820778,-0.0009446151871226,
    -0.0003136475277181,0.0002680724174513,0.0005866614140034,0.0005879345064434,
    0.0003687737484127,0.0001016103320878,-6.392768304008e-05,-7.278518458777e-05,
    2.193913013841e-05,0.0001042716606279,7.135887744586e-05,-0.0001013873231861,
     -0.00034016326204,-0.0005080883105905,-0.000478154032777,-0.0002068439657904,
     0.000229646412227,0.0006573082823906,0.0008774196071331,0.0007589063815876,
    0.0003073125918354,-0.0003234734601727,-0.0008859095325633,-0.001139365365051,
    -0.0009545116913322,-0.0003759410462029,0.0003861643500111, 0.001034889173285,
     0.001305292268612,  0.00107441969511,0.0004164282240327,-0.0004214998469812,
    -0.001114340019443,-0.001387892093177,-0.001129053839164,-0.0004328075845774,
    0.0004335581719282, 0.001135037307426, 0.001400582279995, 0.001129330435574,
    0.0004292653503351,-0.0004265353592891,-0.001107974779333,-0.001356941291698,
    -0.001086209653151,-0.0004099722320426,0.0004045804550767, 0.001043942921725,
     0.001270199980487,   0.0010102948377,0.0003789347076752,-0.0003716513038957,
    -0.0009531636597694,-0.001152805696676,-0.0009114929110682,-0.000339870420803,
    0.0003313951813641,0.0008449918315216, 0.001016070878211,0.0007987445151994,
    0.0002961106891678,-0.000287056942751,-0.0007276895966597,-0.0008699126949097,
    -0.0006798283871139,-0.0002505315211441,0.0002414157724643,0.0006082758088021,
    0.0007226852669604,0.0005612404066697,0.0002055130133773,-0.0001967501180958,
    -0.000492448520268,-0.000581101300591,-0.0004481440596034,-0.0001629256246492,
    0.0001548290518074,0.0003845753815658,0.0004502359090013,0.0003443858772737,
    0.0001241406520938,-0.0001169271808992,-0.0002877438933481,-0.0003336020859099,
    -0.0002525668821034,-9.006132252278e-05,8.385937109964e-05,0.0002038613681484,
    0.0002332848867018,0.0001741592665557,6.117028163222e-05,-5.603097446612e-05,
    -0.0001337931159346,-0.0001501199014663,-0.0001096564969229,-3.758892624412e-05,
     3.34989741319e-05,7.752678577496e-05, 8.39010690493e-05,5.874474703023e-05,
    1.914397061695e-05,-1.603945819095e-05,-3.435093500679e-05,-3.36032209163e-05,
    -2.048397398496e-05,-5.436842394177e-06,3.217087088799e-06,3.036677439071e-06,
    -2.394148991664e-06,-6.512044929606e-06,-4.088071033061e-06, 5.54731725093e-06,
      1.7987427443e-05,2.609366033173e-05,2.390590872561e-05,1.007970678377e-05,
    -1.091430586061e-05,-3.047537385447e-05,-3.968695121378e-05,-3.348438934482e-05,
    -1.322380484262e-05,1.357097126958e-05,3.622476448625e-05,4.538882738528e-05,
    3.702917163282e-05,1.419546271802e-05,-1.41854732762e-05,-3.696301551091e-05,
    -4.530320402156e-05,-3.621380329085e-05,-1.362185762307e-05,1.337185824666e-05,
    3.426076260148e-05,4.132288748444e-05,3.252812363544e-05,1.205547576873e-05,
    -1.166536973145e-05,-2.947262385223e-05,-3.506295473559e-05,-2.722963388714e-05,
    -9.957517522342e-06,9.507797669786e-06,2.370382871785e-05,2.782552576695e-05,
    2.131974605156e-05,7.690589013535e-06,-7.241880705286e-06,-1.779989588537e-05,
    -2.059217202823e-05,-1.554166337062e-05,-5.519366411549e-06,5.113380104981e-06,
    1.235558115453e-05,1.403910836083e-05,1.039583502641e-05,3.617638666754e-06,
    -3.279192392481e-06,-7.738734063195e-06,-8.569689224285e-06,-6.168495385586e-06,
    -2.079997525139e-06
};
